package com.example.demo.utils;

public enum MyEnum {

    SUCCESS("0","success"),
    FAILED("1","failed");


    private String code;
    private String msg;

    MyEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public String getCode() {
        return code;
    }

    public static String getMsg(String code) {
        MyEnum[] values = MyEnum.values();
        for (MyEnum value : values) {
            if (value.getCode().equals(code)) {
                return value.getMsg();
            }
        }
        return "";
    }
}
